<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration {

    /**
     * Run the migrations.
     */
    public function up(): void
    {

        Schema::create('members', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedTinyInteger('status')->default(1)->comment('状态');
            $table->string('nickname', 64)->comment('昵称');
            $table->string('avatar', 300)->nullable()->comment('头像');
            $table->char('phone', 11)->nullable()->unique()->comment('手机号');
            $table->string('password', 64)->nullable()->comment('密码');
            $table->char('openid', 32)->nullable()->comment('微信openid');
            $table->char('unionid', 32)->nullable()->comment('微信unionid');
            $table->datetimes();
        });

    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {

        Schema::dropIfExists('members');

    }
};
